<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('车辆认证审核')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-tuser-add">
        <input name="id" th:value="*{tUser.id}" type="hidden"/>
        <input name="type" value="2" type="hidden"/>

        <div class="form-group">
            <label class="col-sm-3 control-label">车辆认证资料：</label>
            <div class="col-sm-8">
                <img th:src="*{tUser.realNameStatePic}" style="height: 300px" class="img-thumbnail"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label"></label>

            <div class="col-sm-4">
                <button type="button" onclick="submitSuccess()" class="btn btn-w-m btn-primary">审核成功</button>
            </div>
            <div class="col-sm-4">
                <button type="button" onclick="submitFail()" class="btn btn-w-m btn-danger">审核失败</button>
            </div>
        </div>


    </form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "system/tuser/editauth"
    // $("#form-tuser-add").validate({
    //     focusCleanup: true
    // });
    //
    // function submitHandler() {
    //     if ($.validate.form()) {
    //         $.operate.save(prefix + "/add", $('#form-tuser-add').serialize());
    //     }
    // }

    var id = $("input[name='id']").val();
    var type = $("input[name='type']").val();

    function submitSuccess() {
        var data = {
            "id": id,
            "type": type,
            "status": 0
        }
        post(data);
    }

    function submitFail() {
        var data = {
            "id": id,
            "type": type,
            "status": 1
        }
        post(data);
    }


    function post(data) {
        $.operate.save(prefix, data)
    }


</script>
</body>
</html>